import request from '@/utils/request'


export function fetchList(params) {
  return request({
    url: 'data/storage/list',
    method: 'get',
    params
  })
}

export function fetchDetail(params) {
  return request({
    url: 'data/storage/list/' + params.id,
    method: 'get',
    params
  })
}

export function fetchEchartDetail(params) {
  return request({
    url: 'data/storage/chartList/' + params.id,
    method: 'get',
    params
  })
}

/**
 * 删除历史记录
 * @param {*} id 
 * @returns 
 */
export function deleteHistory(id) {
  return request({
    url: `user/receive/history/delete/${id}`,
    method: 'get',
  })
}

export function fetchUploadStep1(params) {
  return request({
    url: 'receive/upload/step1',
    method: 'post',
    params
  })
}

export function fetchUploadStep2(data) {
  return request({
    url: 'receive/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 历史记录，编辑文件名称
 * @param {*} data 
 * @returns 
 */
export function fetchUpdateName(data) {
  return request({
    url: 'user/receive/history/updateName',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

export function fetchVirusStep2(data) {
  return request({
    url: 'receive/virus/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力检测(二步法)提交
export function fetchAffinityStep2(data) {
  return request({
    url: 'receivetwo/affinity/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}
// 亲和力检测提交
export function fetchAffinityStep(data) {
  return request({
    url: 'receive/affinity/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力检测提交
export function fetchAffinityWt(data) {
  return request({
    url: 'wt/affinity/upload/stepA',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力检测200提交
export function fetchAffinityTwoWt(data) {
  return request({
    url: 'affinity200/affinity/upload/stepA',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力二步法(多组)提交
export function fetchAffinitytwomany(data) {
  return request({
    url: 'affinitytwomany/stepA',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力一步法(多组)提交
export function affinityonemany(data) {
  return request({
    url: 'affinityonemany/stepA',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

// 亲和力检测获取结果页面信息
export function fetchUploadStepB({ uuid , uuid_c }) {
  return request({
    url: `/wt/affinity/upload/stepB?uuid=${uuid}&uuid_c=${uuid_c}`,
    method: 'get',
  })
}

// 亲和力检测- 200 获取结果页面信息
export function fetchUploadStepBTwo({ uuid , uuid_c }) {
  return request({
    url: `affinity200/affinity/upload/stepB?uuid=${uuid}&uuid_c=${uuid_c}`,
    method: 'get',
  })
}

// 亲和力二步法（多组）获取结果页面信息
export function fetchTwomanyStepB({ uuid , uuid_c }) {
  return request({
    url: `affinitytwomany/stepB?uuid=${uuid}&uuid_c=${uuid_c}`,
    method: 'get',
  })
}
// 亲和力一步法（多组）获取结果页面信息
export function affinityonemanyStepB({ uuid , uuid_c }) {
  return request({
    url: `affinityonemany/stepB?uuid=${uuid}&uuid_c=${uuid_c}`,
    method: 'get',
  })
}

// 亲和力提交
export function fetchAffinityoneStep2(data) {
  return request({
    url: 'affinityone/affinity/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}
/**
 * 药筛检测  提交信息
 * @param {*} data 
 * @returns 
 */
export function fetchAffinitystepB(data) {
  return request({
    url: 'receive/affinity/upload/stepB',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 结合力药筛  提交信息
 * @param {*} data 
 * @returns 
 */
 export function fetchaffinityYsstepB(data) {
  return request({
    url: 'affinityYs/affinity/upload/stepB',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 蛋白柱状图 ---上传图片
 * @param {*} data 
 * @returns 
 */
 export function fetchapisa(data) {
  return request({
    url: `receive/generate/excel/pisa/${data.uuid}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

export function fetchSandwich(data) {
  return request({
    url: `receive/generate/excel/sandwich/${data.uuid}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns NanoSPR 上传excel
 */
export function fetchNanoSprUpload(data) {
  return request({
    url: `/receive/affinity/upload/nanosStep1/${data.uuid}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns 如海检测 弹窗 提交信息
 */
 export function fetchNanoSprStep2(data) {
  return request({
    url: '/receive/affinity/upload/nanosStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

export function fetchUploadExl(data) {
  return request({
    url: `receive/generate/excel/${data.uuid}`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

export function fetchHistoryList(params) {
  return request({
    url: `user/receive/history`,
    method: 'get',
    params
  })
}

// 详情页信息
export function fetchHistoryDetail(params) {
  return request({
    url: `user/receive/history/${params.id}`,
    method: 'get'
  })
}

// 全部历史记录
export function fetchHistoryAll({id = '', fileName = '', startT = '', endT = '', model = '', page = 1, size = 20}) {
  return request({
    url: `user/receive/history/all`,
    method: 'get',
    params: {
      id,
      fileName,
      startTime: startT,
      endTime: endT,
      pageNo: page,
      pageSize: size,
      model,
    }
  })
}

// 下载文件
// export function fetchHistoryAll({}) {
//   return request({
//     url: `receive/download/excel/${type}/${lang}/ac25fe19-f951-4c6c-ae65-0e7c8ea1a0a0`,
//     method: 'get',
//     params: {
      
//     }
//   })
// }

// 详情页信息
export function fetchHistoryUuid(uuid) {
  return request({
    url: `user/receive/history/uuid/${uuid}`,
    method: 'get'
  })
}

export function fetchIntegration(data) {
  return request({
    url: `receive/integration`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}


export function fetchUploadFileApi(data) {
  return request({
    url: `receive/virus/upload/step1`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
    },
    data
  })
}

export function fetchPackageApi(data) {
  return request({
    url: `user/package/list/${data.locale}`,
    method: 'get'
  })
}

/**
 * 如海检测 -上传excel
 * @param {*} data 
 * @returns 
 */
export function nanosStep1(formData) {
  return request({
    method: 'post',
    url: 'receive/affinity/upload/nanosStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 复享检测 -上传zip
 * @param {*} data 
 * @returns 
 */
 export function fxStep1(formData) {
  return request({
    method: 'post',
    url: 'receive/affinity/upload/fxStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 全部历史 -编辑备注
 * @param {*} data 
 * @returns 
 */
export function updateCompany(data) {
  return request({
    method: 'post',
    url: 'user/receive/history/updateCompany',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns 复享检测 弹窗 提交信息
 */
 export function fxStep2(data) {
  return request({
    url: '/receive/affinity/upload/fxStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 常辉蔗糖水 -上传zip
 * @param {*} data 
 * @returns 
 */
 export function chStep1(formData) {
  return request({
    method: 'post',
    url: '/receive/affinity/upload/chStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 
 * @param {*} data 
 * @returns 常辉蔗糖水 弹窗 提交信息
 */
 export function chStep2(data) {
  return request({
    url: '/receive/affinity/upload/chStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}


/**
 * 
 * @param {*} data 
 * @returns 非洲猪瘟抗体检测 弹窗 提交信息
 */
export function fetchPigStep2(data) {
  return request({
    url: 'receive/pig/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 结合解离 -上传zip
 * @param {*} data 
 * @returns 
 */
 export function jhjlStep1(formData) {
  return request({
    method: 'post',
    url: '/receive/affinity/upload/jhjlStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 
 * @param {*} data 
 * @returns 结合解离 弹窗 提交信息
 */
export function jhjlStep2(data) {
  return request({
    url: '/receive/affinity/upload/jhjlStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns 蛋白定量 弹窗 提交信息
 */
 export function pisaStep2(data) {
  return request({
    url: '/receive/upload/pisa/step2',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns  酶标法定量检测 弹窗 提交信息
 */
 export function pisaOnestep2(data) {
  return request({
    url: '/pisatwo/upload/pisa/step2',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns  定量四联检 弹窗 提交信息
 */
export function joint4Step2(data) {
  return request({
    url: '/joint4/upload/pisa/step2',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 获取历史计算id
export function getHistoryBq(type) {
  return request({
    url: `joint4/upload/getHistoryBq?type=${type}`,
    method: 'get',
  })
}

/**
 * 
 * @param {*} data 
 * @returns  定量复孔检测 弹窗 提交信息
 */
 export function pisaCheck2(data) {
  return request({
    url: '/pisaCheck/upload/pisa/step2',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}


/**
 * 
 * @param {*} data 
 * @returns  酶标定性 弹窗 提交信息
 */
export function jointStep2(data) {
  return request({
    url: '/joint/upload/pisa/step2',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns  酶标定量 弹窗 提交信息
 */
export function quantStep2(data) {
  return request({
    url: '/quant/stepB',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns  酶标法定性检测 弹窗 提交信息
 */
export function receiveStep2(data) {
  return request({
    url: '/receive/mark/upload/stepB',
    method: 'post',
    data: {
      type: 2,
      data: data
    },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns 操作说明
 */
export function explainImgs(lang, type) {
  return request({
    url: `/receive/imgs/${lang}/${type}`,
    method: 'post',
  })
}


/**
 * wespr one -上传zip
 * @param {*} data 
 * @returns 
 */
 export function weSprStep1(formData) {
  return request({
    method: 'post',
    url: '/receive/affinity/upload/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * wespr one 简易版 -上传zip
 * @param {*} data 
 * @returns 
 */
export function weSprEasyStep1(formData) {
  return request({
    method: 'post',
    url: '/simple/affinity/upload/step1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 算法测试 -上传zip
 * @param {*} data 
 * @returns 
 */
export function algorithmStep1(formData) {
  return request({
    method: 'post',
    url: '/demarcation/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * wespr one (扩散) -上传zip
 * @param {*} data 
 * @returns 
 */
export function weSprStepDiffuse1(formData) {
  return request({
    method: 'post',
    url: '/Diffuse/affinity/upload/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * CV test -上传zip
 * @param {*} data 
 * @returns 
 */
export function CvUploadStep1(formData) {
  return request({
    method: 'post',
    url: '/receive/upload/cv',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * wespr one Auto -上传zip
 * @param {*} data 
 * @returns 
 */
export function weSprAutoStep1(formData) {
  return request({
    method: 'post',
    url: '/receive/auto/upload/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * wespr one - Test -上传zip
 * @param {*} data 
 * @returns 
 */
export function weSprStep1Test(formData) {
  return request({
    method: 'post',
    url: '/receive/test/affinity/upload/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * wespr one(稳态) -上传zip
 * @param {*} data 
 * @returns 
 */
export function weSprStatdyStep1(formData) {
  return request({
    method: 'post',
    url: '/onewt/affinity/upload/weSprStep1',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespr one 弹窗 提交信息
 */
export function weSprStep2(data) {
  return request({
    url: '/receive/affinity/upload/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespr one 简易 弹窗 提交信息
 */
export function weSprEasyStep2(data) {
  return request({
    url: '/simple/affinity/upload/step2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns 算法测试 弹窗 提交信息
 */
export function demarcationStep2(data) {
  return request({
    url: '/demarcation/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespr one（扩散版） 弹窗 提交信息
 */
export function weSprStepDiffuse2(data) {
  return request({
    url: '/Diffuse/affinity/upload/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespr one auto 弹窗 提交信息
 */
export function weSprAutoStep2(data) {
  return request({
    url: '/receive/auto/upload/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespr one -Test 弹窗 提交信息
 */
export function weSprStep2Test(data) {
  return request({
    url: '/receive/test/affinity/upload/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns wespronestatdy 弹窗 提交信息
 */
export function weSprStep2onewt(data) {
  return request({
    url: '/onewt/affinity/upload/weSprStep2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*} data 
 * @returns cv test 重新计算
 */
export function weSprCv2Upload(data) {
  return request({
    url: '/receive/upload/cv2',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data: data
    }
  })
}

/**
 * 
 * @param {*}  问题 
 * @returns gpt
 */
export function gptQuestion(q) {
  return request({
    url: `/gpt/say?question=${q}`,
    method: 'get',
  })
}